#ifndef QTSERIALPORT_H
#define QTSERIALPORT_H
#ifdef __cplusplus
extern "C"
{
#endif
#include "serial.h"
#ifdef __cplusplus
}
#endif
//#include  "serial.h"
#include <QString>
#include<QObject>
#include<QThread>
class QtSerialPort:public QThread //public QObject,
{
     Q_OBJECT
private:
        int fd;
        char buf[100];
public:
    QtSerialPort(QObject *parent = 0);//,QObject *parent1=0);
    int open(char *dev);
    QString receive();
    int send(char *buf);
    QString doRecv();
    void  run();
signals:
     void readyRecv();
};

#endif // QTSERIALPORT_H
